#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>
struct stu {
    char xh[5];
    char name[10];
    double  score;


}s[100];
int main() {
    int n, i;
    double ave = 0.0;
    scanf("%d", &n);
    for (i = 0; i < n; i++)
    {
        scanf("%s%s%lf", s[i].xh, s[i].name, &s[i].score);
        ave += s[i].score;
    }


    printf("%.2lf\n", ave / n);
    for (i = 0; i < n; i++)
    { 
        if (s[i].score < ave / n) 
            printf("%s %s\n", s[i].name, s[i].xh);
    }
}